<php>
    $pagetime = time();
</php>
<div class="pageFormContent" layoutH="56">
    <input type="hidden" name="order_count" id="{$domid}_order_count" value="{$datainfo.order_count}"/>
    <div class="panel">
        <h1>基本信息</h1>
        <div>
            <div class="unit">
                <label>
                    商品名称:
                </label>
                <input type="text" name="name" id="{$domid}_name" size="50" class="required" value="{$datainfo.name}">
            </div>
            <div class="unit">
                <label>
                    商品分类:
                </label>
                <include file="GCate:b_select" />
                <div class="clear">
                </div>
            </div>
            <div class="unit">
                <label>
                    商品编号:
                </label>
                <input type="text" name="tcode" id="{$domid}_code" size="30" value="{$datainfo.tcode}">
            </div>
            <div class="unit">
                <label>
                    商品顺序:
                </label>
                <input type="hidden" name="code" id="{$domid}_code" size="30" value="{$datainfo.code}"><input type="text" name="oid" id="{$domid}_oid" size="30" class="required number" value="{$datainfo.oid}">
            </div>
            <div class="unit">
                <label>
                    商品库存:
                </label>
                <input type="text" name="number" id="{$domid}_number" size="50" class="required number" value="{$datainfo.number}">
            </div>
            <div class="unit">
                <label>
                    商品价格:
                </label>
                <input type="text" name="shop_fee" id="{$domid}_shop_fee" size="30" class="required" alt="请输入数字" value="{$datainfo.shop_fee}">元
            </div>
            <div class="unit">
                <label>
                    市场价格:
                </label>
                <input type="text" name="marcket_fee" id="{$domid}_marcket_fee" size="30" class="required" alt="请输入数字" value="{$datainfo.marcket_fee}">元
            </div>
            <div class="unit">
                <label>
                    是否特价:
                </label>
                <select name="is_promote" id="{$domid}_is_promote">
                    <option value="1">是</option>
                    <option value="0" selected="selected">否</option>
                </select>
            </div>
            <div class="unit">
                <label>
                    特价:
                </label>
                <input type="text" name="promote_fee" id="{$domid}_promote_fee" size="30" alt="请输入数字" value="{$datainfo.promote_fee}">元
            </div>
            <div class="unit">
                <label>
                    是否缺货:
                </label>
                <select name="is_lack" id="{$domid}_is_lack">
                    <option value="1">是</option>
                    <option value="0" selected="selected">否</option>
                </select>
            </div>
            <div class="unit">
                <label>
                    小图:
                </label>
                <input type="text" size="30" id="{$domid}_thumb" name="thumb" value="{$datainfo['thumb']}"/><input type="button" id="uploader_{$pagetime}_thumb" value="上传"/>
            </div>
            <div class="unit">
                <label>
                    小图预览:
                </label>
                {$datainfo['thumb']|advstr='200px','200px',$srcpre,'id:'.$domid.'_thumb_view'}
            </div>
            <div class="unit">
                <label>
                    大图:
                </label>
                <input type="text" size="30" id="{$domid}_img" name="img" value="{$datainfo['img']}"/><input type="button" id="uploader_{$pagetime}_img" value="上传"/>
            </div>
            <div class="unit">
                <label>
                    大图 预览350*350:
                </label>
                {$datainfo['img']|advstr='350px','350px',$srcpre,'id:'.$domid.'_img_view'}
            </div>
            <div class="unit">
                <label>
                    商品介绍:
                </label>
                <textarea name="detail" cols="80" rows="15" class="editor" id="{$domid}_detail">
                    {$datainfo.detail}
                </textarea>
            </div>
        </div>
    </div>
    <div class="divider">
    </div>
    <div class="panel">
        <h1>商品属性</h1>
        <div>
            <include file="b_form_fixattr" />
        </div>
    </div>
    <div class="divider">
    </div>
    <div class="panel">
        <h1>商品可选标签</h1>
        <div>
            <include file="b_form_attr" />
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $("#uploader_{$pagetime}_thumb").uploadify({
            "uploader": "/Soabox/Public/Uploadify/uploadify_min.swf",
            "script": "{:U('Tool/doUpload')}",
            "cancelImg": "__PUBLIC__/Uploadify/cancel.png",
            "folder": "/Uploads",
            "auto": true,
            "onComplete": function(event, ID, fileObj, response, data){
                var jsdata = $.parseJSON(response);
                jsdata.rel = "{$domid}_thumb";
                uploader_thumb_callback(jsdata);
            }
        });

		$("#uploader_{$pagetime}_img").uploadify({
            "uploader": "/Soabox/Public/Uploadify/uploadify_min.swf",
            "script": "{:U('Tool/doUpload')}",
            "cancelImg": "__PUBLIC__/Uploadify/cancel.png",
            "folder": "/Uploads",
            "auto": true,
            "onComplete": function(event, ID, fileObj, response, data){
                var jsdata = $.parseJSON(response);
                jsdata.rel = "{$domid}_img";
                uploader_thumb_callback(jsdata);
            }
        });
        
    });
</script>
